package sz.szsmk.citizencard.ui.activity;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chenenyu.router.annotation.Route;

import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.ui.base.IBaseActivity;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/7/27 18:10
 * description:
 */
@Route("about")
public class AboutUsActivity extends IBaseActivity {

    private TextView versionName;

    @Override
    protected int attachLayoutRes() {
        return R.layout.about_us_activity;
    }

    @Override
    protected void initInjector() {

    }

    @Override
    protected void initViews() {

        ImageView back = (ImageView) findViewById(R.id.back);
        versionName = (TextView) findViewById(R.id.version_name);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        TextView title = (TextView) findViewById(R.id.setting_title);
        title.setText("关于我们");

        PackageManager packageManager = getPackageManager();
        String packageName = getPackageName();
        try {
            PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
            String versionname = packageInfo.versionName;
            versionName.setText("v" + versionname);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }

    @Override
    protected void updateViews() {

    }
}
